package com.example.plus.file.comm.util;

import java.io.*;

/**
 * Io流的工具类
 *
 * @author zhouxl
 * @DATE 2020/12/10
 * @descriptoin
 */
public class IoUtil {

    /**
     * 关闭流信息
     *
     * @param closeables
     * @throws IOException
     */
    public static void closeable(Closeable... closeables) throws IOException {
        for (Closeable c : closeables) {
            if (c != null) {
                c.close();
            }
        }
    }

    /**
     * 构建字符流 - 读对象
     *
     * @param in
     * @return
     */
    public static BufferedReader bufferedReader(InputStreamReader in) {
        return new BufferedReader(in);
    }

    /**
     * 构建字符流 - 写对象
     *
     * @param os
     * @return
     */
    public static BufferedWriter bufferedWriter(OutputStreamWriter os) {
        return new BufferedWriter(os);
    }
}
